package com.zhonghan.recharge.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhonghan.common.bean.Result;
import com.zhonghan.recharge.service.ZhCardReceiveService;
/**
 * receive控制层
 * @author Administrator
 *
 */
@RequestMapping("/receive")
@Controller
public class ReceiveController {
	@Autowired
	private ZhCardReceiveService zhCardReceiveService;
	/**
	 * 修改port端口信息
	 * @param id
	 * @param portToken
	 * @param portAppkey
	 * @param portAppsecret
	 * @param portUrl
	 * @param portPhone
	 * @return
	 */
	@RequestMapping("/portUpdate")
	@ResponseBody
	public Result portUpdate(Long id,String portToken,String portAppkey,
			String portAppsecret,String portUrl,String portPhone){
		Result result = new Result();
		int updateZhCardReceiveByPort = zhCardReceiveService.updateZhCardReceiveByPort(id, portToken, portAppkey, portAppsecret, portUrl, portPhone);
		if(updateZhCardReceiveByPort >0){
			result.setCode("1");
			result.setMsg("修改成功");
		}else{
			result.setCode("0");
			result.setMsg("修改失败");
		}
		return result ;
	}
}
